package model;

import java.sql.Timestamp;

/**
 * This is a builder class for Meeting.
 * 
 * The meeting builder class uses the builder design pattern to create an
 * meeting object with multiple parameters.
 * 
 * @author b_aldosa
 * @since June 15 2013
 * @version $Revision: 1.0 $
 */

public class MeetingBuilder {
	/**
	 * properties for the class meeting
	 */
	int id;
	String owner;
	int revisionId;
	String topic;
	String location;
	Timestamp start;
	Timestamp end;
	String attendees;
	String description;

	/**
	 * Parameterless Constructor
	 */
	public MeetingBuilder() {
		id = -1;
		owner = "";
		revisionId = 0;
		topic = "";
		location = "";
		java.util.Date date = new java.util.Date();
		start = new Timestamp(date.getTime());
		end = new Timestamp(date.getTime());
		attendees = "";
		description = "";
	}



	/**
	 * Sets the meetings owner field
	 * 
	 * 
	 * @param owner String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setOwner(String owner) {
		this.owner = owner;
		return this;
	}

	/**
	 * Sets the meeting revision id field
	 * 
	 * @param revisionId int
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setRevisionId(int revisionId) {
		this.revisionId = revisionId;
		return this;
	}

	/**
	 * Sets the meetings topic field
	 * 
	 * 
	 * @param topic String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setTopic(String topic) {
		this.topic = topic;
		return this;
	}
	

	/**
	 * Sets the meetings location field
	 * 
	 * 
	 * @param location
	 *            String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setLocation(String location) {
		this.location = location;
		return this;
	}

	/**
	 * Sets the meeting start field
	 * 
	 * 
	 * @param start
	 *            Timestamp
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setStart(Timestamp start) {
		this.start = start;
		return this;
	}
	

	/**
	 * Sets the meeting end field
	 * 
	 * 
	 * @param end
	 *            Timestamp
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setEnd(Timestamp end) {
		this.end = end;
		return this;
	}
	
	/**
	 * Sets the meetings attendees field
	 * 
	 * 
	 * @param attendees
	 *            String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setAttendees(String attendees) {
		this.attendees = attendees;
		return this;
	}
	
	/**
	 * Sets the meetings description field
	 * 
	 * 
	 * @param description
	 *            String
	 * @return current meeting builder object.
	 */
	public MeetingBuilder setDescription(String description) {
		this.description = description;
		return this;
	}
	

	/**
	 * Build and return the meeting object
	 * 
	 * @return meeting object that has been built.
	 */
	public Meeting build() {
		return new Meeting(this.owner, this.revisionId, 
				this.topic, this.location, this.start,
				this.end,  this.attendees, this.description);
	}

	/**
	 * Returns the meeting id
	 * 
	 * @return the meeting id
	 */
	public int getId() {
		return id;
	}


	/**
	 * Returns the owner
	 * 
	 * @return the owner
	 */
	public String getOwner() {
		return owner;
	}

	/**
	 * Returns the revision id
	 * 
	 * @return the revision id
	 */
	public int getRevisionId() {
		return revisionId;
	}

	/**
	 * Returns the topic
	 * 
	 * @return the topic
	 */
	public String getTopic() {
		return topic;
	}

	/**
	 * Returns the location
	 * 
	 * @return the location
	 */
	public String getLocation() {
		return location;
	}

	/**
	 * Returns the start timestamp
	 * 
	 * @return the start timestamp
	 */
	public Timestamp getStart() {
		return start;
	}

	/**
	 * Returns the end timestamp
	 * 
	 * @return the end timestamp
	 */
	public Timestamp getEnd() {
		return end;
	}

	/**
	 * Returns the attendees
	 * 
	 * @return the attendees
	 */
	public String getAttendees() {
		return attendees;
	}

	/**
	 * Returns the description
	 * 
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

}
